import React from 'react'
import { getCplist } from '../../axios/use'
import { useNavigate } from 'react-router-dom'
import { NavBar } from 'antd-mobile'
import Myxqlist from '../../compont/Myxqlist'
const Index = () => {
    const nav = (useNavigate())
    return (
        <div>
            <div><NavBar back='返回' onBack={() => nav(-1)}>
                04月08日 周二
            </NavBar></div>
            <div style={{ marginTop: '20px' }}>
                <Myxqlist></Myxqlist>
            </div>
        </div>
    )
}

export default Index
export const loader = async ({ request }) => {
    console.log(request.url);
    const url = new URL(request.url)
    console.log(url);
    const data = Object.fromEntries(url.searchParams)
    console.log(data);

    const { data: res } = await getCplist({
        start: data.start,
        end: data.end,
        id: data.id
    })
    console.log(res);
    return {
        info: res
    }
}